package com.sws.orderMS.pojo;

public class OrderItem {

	private long id;			// 订单项id
	private String itemNo;		// 订单项编号
	private Product product;	// 商品
	private int amount;			// 数量
	private String memo;		// 备注
	
	public OrderItem() {
	}
	
	public OrderItem(long id, String itemNo, Product product, 
					 int amount, String memo) {
		this.id = id;
		this.itemNo = itemNo;
		this.product = product;
		this.amount = amount;
		this.memo = memo;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getItemNo() {
		return itemNo;
	}

	public void setItemNo(String itemNo) {
		this.itemNo = itemNo;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}
	
	public double getMoney() {
		return product.getPrice() * amount;
	}
	
	public String toString() {
		return "[商品名称:" + product.getName() + 
			   ", 数量:" + amount + 
			   ", 备注:" + memo +
			   ", 金额:" + getMoney() + "元]";
	}
	
}
